﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="AsignarMenuPerfil.aspx.cs" Inherits="AsignarMenuPerfil" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphAYNI" runat="Server">
    <script type="text/javascript">
        function Validar() {
            $("#colorbox, #cboxOverlay").appendTo('form:first');
            AbrirModal('330', '210', true, false, '#yesno', false);
            $('#yesno').css("display", "block");
            return false;
       }

        function Cerrar() {
            $('#yesno').css("display", "none");
            $('#confirmacion').css("display", "none");
            window.CerrarModal();
        }

        function Aceptar() {
            //window.CerrarModal();
            //window.parent.location.reload();
            window.parent.location = window.parent.location.href;
        }
    </script>

    <asp:ScriptManager ID="script" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="upFormulario" runat="server">
        <ContentTemplate>
            <div class="titulo-int">Asignar Menú a Perfil</div>
            <div class="div-box-gris">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="txt-campos-int">Sistema</td>
                        <td>
                            <asp:DropDownList runat="server" ID="ddlSistema" class="field_element"></asp:DropDownList>
                        <td>
                        <td class="txt-campos-int">Perfil</td>
                        <td>
                            <asp:DropDownList runat="server" ID="ddlPerfil" class="field_element"></asp:DropDownList></td>
                        <td>
                            <asp:Button ID="btnBuscar" runat="server" Text="Buscar" CssClass="skip"  OnClick="btnBuscar_Click" /></td>
                    </tr>
                </table>
            </div>
            <br />
            <div class="div-scrollTreeview">
                <asp:TreeView ID="trvMenu" runat="server" ImageSet="Arrows" ShowLines="True" ShowCheckBoxes="All">
                    <HoverNodeStyle CssClass="HoverNodeStyle" />
                    <NodeStyle CssClass="NodeStyle" Font-Underline="false" HorizontalPadding="5px" />
                    <ParentNodeStyle Font-Bold="False" />
                    <SelectedNodeStyle CssClass="SelectedNodeStyle" Font-Underline="True" HorizontalPadding="5px" />
                </asp:TreeView>
            </div>
            <div class="btn-acciones">
                <table width="100%" align="left" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td align="left">
                            <asp:Button runat="server" ID="btnGrabar" OnClientClick="return Validar()" CssClass="skip" Text="Grabar"/>
                            <asp:Button runat="server" ID="btnCancelar" CssClass="skip" Text="Cancelar" OnClick="btnCancelar_Click" />
                        </td>
                    </tr>
                </table>
            </div>

            <div id="yesno" style="display: none">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="titulo-modal">Mensaje del Sistema</td>
                    </tr>
                </table>
                <br />
                <table width="100%" align="center" border="0" cellspacing="2" cellpadding="1">
                    <tr>
                        <td align="center" width="72">
                            <img alt="Interrogación" src="../../images/icon-interrogacion-modal.png" /></td>
                        <td class="" align="center" style="padding-left: 6px; padding-right: 6px;">¿Esta seguro que desea guardar los cambios?</td>
                    </tr>
                </table>
                <table width="80%" border="0" align="center" cellspacing="0" cellpadding="0">
                    <tr>
                        <td align="center">
                            <asp:Button ID="btnSi" runat="server" CssClass="skip" Text="Si" OnClick="btnSi_Click1"/>
                            <asp:Button ID="btnNo" runat="server" CssClass="skip" Text="No" OnClientClick="Cerrar();" />
                        </td>
                    </tr>
                </table>
            </div>

            <div id="confirmacion" style="display: none">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="titulo-modal">Mensaje del Sistema</td>
                    </tr>
                </table>
                <br />
                <table width="100%" align="center" border="0" cellspacing="2" cellpadding="1">
                    <tr>
                        <td align="center" width="72">
                            <img alt="confirmacion" src="../../images/icon-valido.png" /></td>
                        <td class="" align="center" style="padding-left: 6px; padding-right: 6px;">Los datos han sido grabados correctamente.</td>
                    </tr>
                </table>
                <table width="80%" border="0" align="center" cellspacing="0" cellpadding="0">
                    <tr>
                        <td align="center">
                            <asp:Button ID="btnAceptar" runat="server" CssClass="skip" Text="Aceptar" OnClientClick="Aceptar();" />
                        </td>
                    </tr>
                </table>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

